package com.naughty.shopapi.pojo;

import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;

@Data
@AllArgsConstructor
@NoArgsConstructor
@ToString
@Accessors(chain = true)
@TableName(value = "Goods", autoResultMap = true)
public class Goods implements Serializable {
    @TableId(type = IdType.AUTO)
    private Integer id;
    private Integer user_id;
    private Integer category_id;
    private String title;
    private String description;
    private Integer price;
    private Integer stock;
    private String cover;
    private String cover_url;
    @TableField(typeHandler = FastjsonTypeHandler.class)
    private ArrayList pics;
    @TableField(typeHandler = FastjsonTypeHandler.class)
    private ArrayList pics_url;
    private Integer is_collect;
    private String details;
    private Integer sales;
    private Integer is_on;
    private Integer is_recommend;
    private Integer collects_count;
    @JsonIgnore
    private Integer comments_count;
    @TableField(fill = FieldFill.INSERT)
    private Date created_at;
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Date updated_at;
    //        comments

}
